import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab02VO, Ab02Form, Ab02Query } from '@/api/yuanshidian/ab02/types';

/**
 * 查询原在职人员信息列表
 * @param query
 * @returns {*}
 */

export const listAb02 = (query?: Ab02Query): AxiosPromise<Ab02VO[]> => {
  return request({
    url: '/yuanshidian/ab02/list',
    method: 'get',
    params: query
  });
};
/**
 * 查询原在职人员信息列表
 * @param query
 * @returns {*}
 */

export const customPageList = (query?: Ab02Query): AxiosPromise<Ab02VO[]> => {
  return request({
    url: '/yuanshidian/ab02/customPageList',
    method: 'get',
    params: query
  });
};
/**
 * 查询原在职人员信息详细
 * @param ID
 */
export const getAb02 = (ID: string | number): AxiosPromise<Ab02VO> => {
  return request({
    url: '/yuanshidian/ab02/' + ID,
    method: 'get'
  });
};
/**
 * 查询新在职人员信息详细
 * @param ID
 */
export const getAb02New = (ID: string | number): AxiosPromise<Ab02VO> => {
  return request({
    url: '/yuanshidian/ab02new/' + ID,
    method: 'get'
  });
};
/**
 * 新增原在职人员信息
 * @param data
 */
export const addAb02 = (data: Ab02Form) => {
  return request({
    url: '/yuanshidian/ab02',
    method: 'post',
    data: data
  });
};

/**
 * 修改原在职人员信息
 * @param data
 */
export const updateAb02 = (data: Ab02Form) => {
  return request({
    url: '/yuanshidian/ab02',
    method: 'put',
    data: data
  });
};

/**
 * 删除原在职人员信息
 * @param ID
 */
export const delAb02 = (ID: string | number) => {
  return request({
    url: '/yuanshidian/ab02/' + ID,
    method: 'delete'
  });
};
/**
 * 提交审核信息
 * @param ID
 */
export const submit = (ID: string | number): AxiosPromise<Ab02VO> => {
  return request({
    url: '/yuanshidian/ab02/submit/' + ID,
    method: 'get'
  });
};
/**
 * 审核
 * @param
 */
export const examine = (query?: Ab02Query): AxiosPromise<Ab02VO[]> => {
  return request({
    url: '/yuanshidian/ab02/examine',
    method: 'post',
    data: query
  });
};
export const sfzlist = (data) => {
  return request({
    url: '/yuanshidian/ab02/sfzlist',
    method: 'get',
    params: data
  });
};
/**
 * 人员信息驳回
 * @param ID
 */
export const turndownab02 = (ID: string | number): AxiosPromise<Ab02VO> => {
  return request({
    url: '/yuanshidian/ab02/turndown/' + ID,
    method: 'get'
  });
};
export const calculateSocialCostGr03 = (data: Object): AxiosPromise<Ab02VO> => {
  return request({
    url: '/yuanshidian/ab04/calculateSocialCostGr03',
    method: 'get',
    params: data
  });
};